.index {
  min-height: 100vh;
  position: relative;
  padding-bottom: 100px; // 为按钮预留空间
  overflow-x: hidden;

  .header {
    padding: 15px;
    border-bottom: 1px solid #eee;
    background-color: #f8f8f8;
    position: sticky;
    top: 0;
    z-index: 10;

    .title {
      font-size: 20px;
      font-weight: bold;
      text-align: center;
      color: #333;
    }
  }

  .content-area {
    padding: 20px;
    padding-bottom: 120px; // 确保内容不被按钮遮挡
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    pointer-events: auto;

    &.preview-content {
      background-color: #f5f5f5;
    }
  }

  .editor-section {
    margin-bottom: 20px;
    height: 100%;

    .section-title {
      font-size: 18px;
      font-weight: bold;
      margin-bottom: 10px;
      color: #333;
    }

    .markdown-textarea {
      min-height: 70vh !important;
      height: auto;
      padding: 10px;
      font-size: 16px;
      line-height: 1.5;
      border: 1px solid #ddd;
      border-radius: 4px;
      width: 100%;
      box-sizing: border-box;
    }
  }

  .footer {
    padding: 20px 15px 30px;
    background-color: #f0f0f0;
    border-top: 1px solid #ddd;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
  }

  .action-buttons {
    display: flex;
    justify-content: center;
    padding: 0;
  }

  .btn {
    flex: 1;
    max-width: 90%;
    margin: 0 10px;
    border-radius: 10px;
    height: 75px !important;
    line-height: 75px !important;
    font-size: 22px !important;
    font-weight: bold !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    padding: 0 !important;
    position: relative;
    z-index: 1000;
    pointer-events: auto !important;
  }

  .convert-btn {
    background-color: #4CAF50 !important;
    color: white !important;

    &:active {
      opacity: 0.8;
      transform: translateY(2px);
    }
  }

  .back-btn {
    background-color: #757575 !important;
    color: white !important;
  }

  .save-btn {
    background-color: #2196F3 !important;
    color: white !important;
  }

  .image-preview {
    background-color: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;

    image {
      width: 100%;
      border: 1px solid #eee;
      border-radius: 4px;
      display: block;
    }

    .loading-message {
      padding: 40px 20px;
      text-align: center;
      color: #999;
      font-size: 16px;
    }
  }

  .hidden-canvas {
    position: absolute;
    left: -9999px;
    top: -9999px;
  }

  .action-buttons:not(:has(.back-btn)) .btn,
  .action-buttons:not(:has(.save-btn)) .btn {
    width: 80% !important;
  }

  .preview-content + .footer .btn {
    width: 45% !important;
    margin: 0 8px;
  }
}

// 添加调试面板样式
.debug-toggle {
  position: fixed;
  bottom: 5px;
  right: 5px;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  z-index: 110;
}

.debug-panel {
  position: fixed;
  bottom: 30px;
  left: 5px;
  right: 5px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  border-radius: 4px;
  z-index: 105;
  max-height: 200px;
  overflow-y: auto;

  .debug-header {
    padding: 5px;
    border-bottom: 1px solid #555;
    font-weight: bold;
  }

  .debug-content {
    padding: 5px;

    .debug-item {
      font-family: monospace;
      font-size: 12px;
      padding: 3px 0;
      border-bottom: 1px solid #333;
    }
  }
}

// 创建全新的悬浮按钮
.floating-buttons {
  position: fixed;
  bottom: 20px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  padding: 0 15px;
  z-index: 9999; // 极高的z-index确保不被覆盖
}

.floating-btn {
  margin: 0 5px;
  height: 60px !important;
  line-height: 60px !important;
  font-size: 20px !important;
  font-weight: bold !important;
  border-radius: 30px !important;
  color: white !important;
  box-shadow: 0 3px 10px rgba(0,0,0,0.3) !important;
  border: none !important;
}

.button-hover {
  opacity: 0.85 !important;
  transform: translateY(2px) !important;
}

.generate {
  width: 90% !important;
  background-color: #4CAF50 !important;
}

.back {
  width: 45% !important;
  background-color: #757575 !important;
}

.save {
  width: 45% !important;
  background-color: #2196F3 !important;
}

// 完全重构页面布局，使用简单直接的样式
.simple-page {
  padding: 15px;
  height: 100vh;
  position: relative;
  box-sizing: border-box;
  background-color: #fff;
}

.editor-content {
  margin-bottom: 20px;
}

.simple-textarea {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 10px;
  font-size: 16px;
  margin-bottom: 150px;
}

.preview-content {
  padding-bottom: 180px;

  image {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  }

  .loading-text {
    text-align: center;
    padding: 30px;
    color: #666;
  }
}

.button-area {
  position: fixed;
  bottom: 40px;
  left: 0;
  right: 0;
  padding: 0 20px;
  z-index: 9999;
}

.action-btn {
  height: 120px;
  line-height: 120px;
  text-align: center;
  color: white;
  font-size: 36px;
  font-weight: bold;
  border-radius: 60px;
  box-shadow: 0 6px 12px rgba(0,0,0,0.3);
  margin: 0 auto;
}

.generate-btn {
  width: 90%;
  background-color: #4CAF50;
}

.button-group {
  display: flex;
  justify-content: space-between;
  gap: 15px;
}

.back-btn, .save-btn {
  width: 45%;
}

.back-btn {
  background-color: #757575;
}

.save-btn {
  background-color: #2196F3;
}

.btn-hover {
  opacity: 0.8;
  transform: translateY(2px);
}

.offscreen-canvas {
  position: absolute;
  visibility: hidden;
  left: -9999px;
  top: -9999px;
}
